﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MudEngine.Parsing.AST
{
    public enum UnaryOperatorType
    {
        Any = 0,
        Not = 1,
        BitNot = 2,
        Minus = 3,
        Plus = 4,
        Increment = 5,
        Decrement = 6,
        PostIncrement = 7,
        PostDecrement = 8,
        Dereference = 9,
        AddressOf = 10,
        Await = 11,
    }

    public class UnaryExpression : Expression
    {
        public UnaryOperatorType Operator { get; set; }
        public Expression Expression { get; set; }

        public UnaryExpression(UnaryOperatorType op, Expression expression)
        {
            this.Operator = op;
			this.Expression = expression;
			this.Expression.Parent = this;
        }

        public override void AcceptVisitor<C>(IAstNodeVisitor<C> visitor, C ctx)
        {
            visitor.VisitUnaryExpression(this, ctx);
        }
    }
}
